package com.railway.servlet;

import java.io.IOException;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.railway.service.OrderService;
import com.railway.service.impl.OrderServiceImpl;
import com.railway.util.JSONUtil;

/**
 * Servlet implementation class PaidOrder
 */
/**支付订单
 * @author 33676
 *
 */
@WebServlet(name = "PaidOrderServlet", urlPatterns = { "/PaidOrderServlet.do" })
public class PaidOrder extends HttpServlet {
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("Utf-8");
		int order_id = 0;
		if(request.getParameter("order_id") != null && !"".equals(request.getParameter("order_id"))) {
			order_id = Integer.parseInt(request.getParameter("order_id"));
		}
		OrderService os = new OrderServiceImpl();
		JSONUtil.responJSOn(response, os.paidOrder(order_id));
	}
}
